import matplotlib.pyplot as plt

def errorbar(x,y,xerr=None,yerr=None,xerr95=None,yerr95=None, color='k'):
    """Errorbars Gelman-style"""
    ax = plt.gca()
    if xerr is not None:
        if xerr95 is None: xerr95=2*xerr
        ax.plot( (x-xerr95,x+xerr95), (y, y), linewidth=1, color=color)
        ax.plot( (x-xerr,  x+xerr  ), (y, y), linewidth=2, color=color)
    if yerr is not None:
        if yerr95 is None: yerr95=2*yerr
        ax.plot( (x,x), (y-yerr95, y+yerr95), linewidth=1, color=color)
        ax.plot( (x,x), (y-yerr,   y+yerr  ), linewidth=2, color=color)
    ax.scatter( x, y, color=color)
